applicationwindow: Fix code sample
authorTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 10:41:47 +0000 (12:41 +0200)
committerTimm Bäder <mail@baedert.org>
Wed, 11 Oct 2017 10:41:47 +0000 (12:41 +0200)
Declare all variables, use proper GtkApplication constructor and the
right GTK_APPLICATION() cast for gtk_application* API.

gtk/gtkapplicationwindow.c

index 9c028a24599d0ba5cbfff8ee8fcb5377ff6da09a..2a33ceb3f94c48c04109f4cc8c83cffeb52491b9 100644 (file)
@@ -79,9 +79,9 @@
  * ## A GtkApplicationWindow with a menubar
  *
  * |[<!-- language="C" -->
- * app = gtk_application_new ();
+ * GtkApplication *app = gtk_application_new ("org.gtk.test", 0);
  *
- * builder = gtk_builder_new_from_string (
+ * GtkBuilder *builder = gtk_builder_new_from_string (
  *     "<interface>"
  *     "  <menu id='menubar'>"
  *     "    <submenu label='_Edit'>"
  *     "</interface>",
  *     -1);
  *
- * menubar = G_MENU_MODEL (gtk_builder_get_object (builder,
- *                                                 "menubar"));
- * gtk_application_set_menubar (G_APPLICATION (app), menubar);
+ * GMenuModel *menubar = G_MENU_MODEL (gtk_builder_get_object (builder,
+ *                                                            "menubar"));
+ * gtk_application_set_menubar (GTK_APPLICATION (app), menubar);
  * g_object_unref (builder);
  *
- * ...
+ * // ...
  *
- * window = gtk_application_window_new (app);
+ * GtkWidget *window = gtk_application_window_new (app);
  * ]|
  *
  * ## Handling fallback yourself